package com.qufenqi.pay.abs.common.utils;

import com.qufenqi.pay.abs.common.CommConstant;

/**
 * Created by wangyi on 16/5/16.
 */
public class PageUtil {

    /**
     * QuartzJob.perthreadcount为叶容量,计算分页页数
     * @param count 目标数据条数
     * @return
     */
    public static int countCycleTimes(int count){
        int tempLast = count%CommConstant.Sys.perthreadcount;
        int tempCount = count/CommConstant.Sys.perthreadcount;
        return tempLast==0?tempCount:tempCount+1;
    }

    /**
     * QuartzJob.perthreadcount为叶容量,计算分页页数
     * @param count 目标数据条数
     * @return
     */
    public static int countPages(int count,int number){
        int tempLast = count%number;
        int tempCount = count/number;
        return tempLast==0?tempCount:tempCount+1;
    }
}
